<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
<title>奖品查询</title>
<link href="/assets/css/jingang_style1.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="/assets/js/jquery-1.9.1.min.js"></script>
</head>

<body>
	<div class="w">
		<div class="bg-box4">
			<div class="search-car">
				<form>
					<input type="text" name="search-in" class="search-input" placeholder="请输入您的手机号">
					<input type="button" value="" class="inps_btn">
				</form>
			</div>
			<div class="search-content">
				<p id="resu"></p>
				<p class="bingo">恭喜您，获得xxxx奖品<br/>请前往兑奖处领取</p>
				<div class="search-list">
					<h5>中奖信息</h5>
				    <div class="topRec_List topRec_List2">
				        <div class="maquee">
				            <ul>
								<volist name="result" id="v" empty="还没有开始抽奖">
				                <li>
				                    <div>{$v['name']|msubstr1=1,1}**</div>
				                    <div>{$v['mobile']|substr=0,3}****{$v['mobile']|substr=-4,4}</div>
				                    <div>{:W('Jgward/getaward',array('id'=>$v['awardid'],'field'=>'awardname'))}</div>
				                </li>
								</volist>
	            			</ul>
				        </div>
				    </div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		$(function(){
			var redirecturl = "{$getURL}";
			/*提交报名，同时并再一次验证手机号码是否存在*/
			$(".inps_btn").click(function(){
				var mobile = $("input[name='search-in']").val();
				var reg = /^0?1[3|4|5|8|7][0-9]\d{8}$/;
				if (!reg.test(mobile)) {
					alert("请输入正确的手机号码！");
					$("input[name='search-in']").val(null);
					$("input[name='search-in']").focus();
					return false;
				}else{
					var savetel_url = "/Home/Jgshow/searchs";
					var teldata = {"mobile":mobile,random:Math.random()};
					$.ajax({
						url:savetel_url,
						data:teldata,
						type:"POST",
						dataType:"JSON",
						success:function (data){
							var res = data.ret;
							if(res==0){
								$("#resu").html("很遗憾，未查询到您的信息<br/>请核对后重新查看");
							}else{
								$("#resu").html("恭喜您：获得 "+res);
							}
						}
					});
				}
			})
		});
	</script>
<script type="text/javascript"> 
	  function autoScroll(obj){
			$(obj).find("ul").animate({
				marginTop : "-39px"
			},500,function(){
				$(this).css({marginTop : "0px"}).find("li:first").appendTo(this);
			})
		}
		$(function(){
			setInterval('autoScroll(".maquee")',3000);

		})
</script> 
</body>
</html>
